﻿BoxSportSystem.pagosCamara = (function () {

    
    var viewModel = kendo.observable({
        GetCamara: function (e) {
            onShow();
        }, cameraSucces: function (imgURL) {
            $("#imagen").attr("scr", imgeURL);
            $.imgeURL = imgeURL;            
        },
        onBodyLoad:function () {
            document.addEventListener("deviceready", onDeviceReady, false);
        }
    });

    function onShow(e) {
        e.stopPropagation();
        navigator.camera.getPicture(cameraSuccess, cameraError, {
            quality: 50,
            destinationType: Camara.PictureSourceType.CAMERA,
            allowEdit: true,
            encondingType: Camera.EncondingType.JPG,
            saveToPhotoAlbum: true
        });
    }

    return {
        onShow: onShow,
        viewModel: viewModel
    };

})(window);

